import request from "@/utils/request";
import dataOpt   from '@/utils/data-opt'


let getUserMenus = (params)=>{
    return request({
        url:"/generic/sys/menu/userlist",
        method:"get",
        params:params
    })
}

export function getMenus(){
    return  new Promise((resolve, reject) => {
        getUserMenus({menuType:1}).then(rsp =>{
            let transferToTreeData = dataOpt.transferToRouterData(rsp.data);
            resolve(transferToTreeData);
        }).catch(reason => reject(reason));
    })
}

export function getUserInfo(){
    return request({
        url:"/generic/sys/user/userinfo",
        method:"get"
    })
}